<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>登录</title>
	<link rel="stylesheet" href="/scriptZIP/index.css">
	<style>
		.el-button {
			width: 178px;
			line-height: 50px;
			font-size: 18px;
		}
	</style>
</head>

<body>
	<div id="login_WQ">
		<el-container>
			<el-header>

			</el-header>
			<el-main v-loading="loading" style="text-align: center;">
				<el-button type="primary" size="medium" @click="loginSchool(schoolId)">进入学校</el-button>
			</el-main>
		</el-container>
	</div>
	<script src="https://cdn.w7.cc/ued/console/jssdkv2.js"></script>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/scriptZIP/flatpickr.min.js"></script>
	<script src="/scriptZIP/zh.min.js"></script>
	<script src="https://unpkg.com/element-ui/lib/index.js"></script>

	<script src="/lib/vue-flatpickr.min.js"></script>
	<!-- <script src="https://cdn.bootcdn.net/ajax/libs/js-cookie/3.0.5/js.cookie.js"></script> -->
	<!-- <script src="/js/common.js"></script> -->
	<script>
		new Vue({
			el: '#login_WQ',
			data: {
				code: '',
				loading: false,
				schoolId: ''
			},
			mounted: function () {
				var that = this
				w7.ready(function () {
					w7.login(function (evt) {
						this.code = evt.data.code;
						// console.log(this.code, 'code1');
						var obj = { code: this.code }
						axios.post('https://wei.hxt5.com/api/wq', new URLSearchParams(obj)).then(function (e) {
							that.schoolId = e.data.schoolId
							axios.post('https://wei.hxt5.com/api/login', new URLSearchParams(e.data)).then(function (res) {
								// setTimeout(() => {
								// 	that.loading = true
								// 	// open("https://wei.hxt5.com/school/school_menu.html?id=" + schoolId, '_blank');
								// }, 2000)

							}.bind(this));

						}.bind(this));

					});
				});

			},
			methods: {
				loginSchool(schoolId) {
					this.loading=true
					setTimeout(() => {
						this.loading = false
						open("https://wei.hxt5.com/school/school_menu.html?id=" + schoolId, '_blank');
					}, 1300)
					
				}
			}
		})
	</script>
</body>

</html>